<?
define('NOROBOT', TRUE);
require_once '../../include/common.inc.php';

//幻灯新闻
$txt_len=5;//标题太长，取的字符长度限制
$str="";
$sql_news="select CONCAT(LEFT(title,$txt_len),'...') as newtitle,bl_move.* from bl_move limit 5;";
$row_news=$db->fetch_all($sql_news);
//print_r($row_news);


foreach($row_news as $news){
	$str.="ati('$news[url]', '$news[pic]', '$news[newtitle]');";
}
//echo "str=".$str;
//die();
?>
<!--幻灯片新闻开始-->
<div id="slideimg">  
    <script language=javascript>
	var focus_width=250     /*幻灯片新闻图片宽度*/
	var focus_height=220    /*幻灯片新闻图片高度*/
	var text_height=18    /*幻灯片新闻文字标题高度*/
	var swf_height = focus_height+text_height

	var pics = '';
	var links = '';
	var texts = '';
	function ati(url, img, title){
		if(pics != ''){
			pics = "|" + pics;
			links = "|" + links;
			texts = "|" + texts;
		}
		pics = escape(img) + pics;
		links = escape(url) + links;
		texts = title + texts;
	}
    </script>
    <script language=javascript>
	<?=$str ?>
	document.write('<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#DADADA" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"/>');
</script>
</div>
<!--幻灯片新闻结束-->
